How To Handle Exception In A Stored Function In PostgreSQ